<?php

$middleware = [
	//"default_namespace" => "app\\http\middleware",
	// "record" => "app\http\middleware\Record::class",
	// "crossDomain" => "app\http\middleware\crossDomain"
];

var_dump(array_shift($middleware));die;
array_shift($middleware);
var_dump($middleware);die;


foreach ($middleware as $item) {
	var_dump($item);die;
}

//list($middleware, $param) = $middleware;




$middlewares = [
	"validate",
	"checkLegeistll",
	"formatter",
	"end"
];

$res = array_map(function ($middleware) {
		
	return function ($request, $next) use ($middleware) {
	
		[$call, $params] = $middleware;
		
		
	};
	
}, $middlewares);

var_dump($res);die;

?>